<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class test extends CI_Controller {

	/**
	 * Index Page for this controller.
	 *
	 * Maps to the following URL
	 * 		http://example.com/index.php/welcome
	 *	- or -  
	 * 		http://example.com/index.php/welcome/index
	 *	- or -
	 * Since this controller is set as the default controller in 
	 * config/routes.php, it's displayed at http://example.com/
	 *
	 * So any other public methods not prefixed with an underscore will
	 * map to /index.php/welcome/<method_name>
	 * @see http://codeigniter.com/user_guide/general/urls.html
	 */
	public function index()
	{
                      
	}
        
                public function toexcel(){
                header("Content-Type: application/vnd.ms-excel");
                header("Expires: 0");
                header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
                header("content-disposition: attachment;filename=RP0036.xls");
                echo '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">';
                echo '<html xmlns:o="urn:schemas-microsoft-com:office:office"xmlns:x="urn:schemas-microsoft-com:office:excel"xmlns="http://www.w3.org/TR/REC-html40">';
                echo '<body>';
                echo '  <table style="margin: 0 auto" align="center" class="formtable" width="94%" border="0" cellspacing="0" cellpadding="0">
          <tbody><tr>
            <th colspan="8" align="center" valign="middle">
                &nbsp;<b>แสดงข้อมูลนักศึกษาลงทะเบียนเข้าร่วมกิจกรรม :  ทดสอบระบบกิจกรรม2 </b>
            </th>
          </tr>
          <tr>
            <th width="9%" align="center" valign="middle">รหัส</th>
            <th width="15%" align="center" valign="middle">ชื่อ-สกุล</th>
            <th width="12%" align="center" valign="middle">โปรแกรมวิชา</th>
            <th width="3%" align="center" valign="middle">ชั้นปี</th>
            <th width="13%" align="center" valign="middle">รหัสลงทะเบียน</th>
          </tr>
                    <tr>
            <td align="center" valign="middle">&nbsp;<b>56123927</b></td>
            <td align="left" valign="middle">&nbsp;เกรียงไกร  วิจิตร</td>
            <td align="center" valign="middle">&nbsp;การรักษาความปลอดภัยบนเว็บ</td>
            <td align="center" valign="middle">&nbsp;1</td>
            <td align="center" valign="middle">
                <b> 8e0db7d3b7760e5aa6999847324856ce</b>
            </td>
          </tr>
                    <tr>
            <td align="center" valign="middle">&nbsp;<b>52123925</b></td>
            <td align="left" valign="middle">&nbsp;ศรัญญู  กล้าหาญ</td>
            <td align="center" valign="middle">&nbsp;เทคโนโลยีสารสนเทศ</td>
            <td align="center" valign="middle">&nbsp;5</td>
            <td align="center" valign="middle">
                <b> b436dfbb2cec16b0ce1c8f12cc70a8ea</b>
            </td>
          </tr>
                    <tr>
            <td align="center" valign="middle">&nbsp;<b>52173987</b></td>
            <td align="left" valign="middle">&nbsp;วราเทพ</td>
            <td align="center" valign="middle">&nbsp;เทคโนโลยีสารสนเทศ</td>
            <td align="center" valign="middle">&nbsp;5</td>
            <td align="center" valign="middle">
                <b> 3e324156c4ec8d3626a1ffaf9b3d6412</b>
            </td>
          </tr>
                    <tr>
            <td align="center" valign="middle">&nbsp;<b>52123926</b></td>
            <td align="left" valign="middle">&nbsp;วรเทพ  อินตาวงศ์</td>
            <td align="center" valign="middle">&nbsp;เทคโนโลยีสารสนเทศ</td>
            <td align="center" valign="middle">&nbsp;5</td>
            <td align="center" valign="middle">
                <b> 5fb55aec6ef02ef50e2faa9bce2446ea</b>
            </td>
          </tr>
                    <tr>
            <td align="center" valign="middle">&nbsp;<b>52170031</b></td>
            <td align="left" valign="middle">&nbsp;อนุสร  ไชยแก้ว</td>
            <td align="center" valign="middle">&nbsp;เทคโนโลยีสารสนเทศ</td>
            <td align="center" valign="middle">&nbsp;5</td>
            <td align="center" valign="middle">
                <b> c12b55ab26feb5bef6d8255084d532ce</b>
            </td>
          </tr>
                    <tr>
            <td align="center" valign="middle">&nbsp;<b>54123890</b></td>
            <td align="left" valign="middle">&nbsp;บุญชัย  เตชณรงณ์</td>
            <td align="center" valign="middle">&nbsp;เทคโนโลยีสารสนเทศ</td>
            <td align="center" valign="middle">&nbsp;3</td>
            <td align="center" valign="middle">
                <b> 16fc763e49e8a32139611185fe4e712a</b>
            </td>
          </tr>
                  </tbody></table>';
                echo '</body>';
                echo '</html>';
                }
        
                public function excelread(){
                    
                      function eachcell($array_value){
                          echo print_r($array_value) . "<br />";
                      }
                      
                      $this->load->library("excellib");
                      $this->excellib->load("C:/test.xlsx");
                      $this->excellib->read(eachcell);
                }
                
                public function drop(){
                
                             $this->load->view("drop",null);
                     
                             
                }
}

/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */